<?php
class FunctionController extends AdminBaseController  {
	public function lists(){
		$data['list'] = HttpServerManager::getFunctionServer()->infiniteClass(array('id'=>0));
		return $data;
	}
	public function add(){
		if (!empty($_GET['id'])){
			$data = HttpDaoManager::getFunctionDao()->get($_GET['id']);
		}
		$data['functions'] = HttpServerManager::getFunctionServer()->infiniteClass(array('id'=>0));		
		$data['id'] = isset($data['id'])?$data['id']: Common::getGetStrValue('id');
		return $data;
	}
	public function subAdd(){
		HttpDaoManager::getFunctionDao()->add($_POST);
		ClassManager::getToos()->msgbox("添加成功");
	}
	public function subUpdate(){
		HttpDaoManager::getFunctionDao()->update($_POST,$_POST['id']);
		ClassManager::getToos()->msgbox("修改成功",'function_lists.html');
	}
	public function delete(){
		HttpServerManager::getFunctionServer()->deleteBatchByid($_GET['id']);
		ClassManager::getToos()->msgbox("删除成功");
	}
}
?>